package summary.reflect;

import java.lang.reflect.InvocationTargetException;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/15
 * @VERSION 1.0
 * @DESC
 * summary.reflect api
 */
public class ReflectApi {
    public  void hello(){
        System.out.println("hello...");
    }
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class c = ReflectApi.class;
        ReflectApi reflectApi= new ReflectApi();
        reflectApi.hello();

        reflectApi=(ReflectApi) c.newInstance();
        reflectApi.hello();

        reflectApi = (ReflectApi) c.getDeclaredConstructor().newInstance();
        reflectApi.hello();

    }
}
